home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -in_the_mag- / reader_requests / wild / support / wilf / modules / meta.h < prev    next >
C/C++ Source or Header  |  2000-02-23  |  2KB  |  63 lines

  1. #ifndef    META_DEFS
  2. #define META_DEFS
  3.  
  4. #include <inline/dos.h>
  5. #include <inline/exec.h>
  6.  
  7. struct Common
  8. {
  9.  struct    MinNode        com_Node;
  10.  struct MinList        com_Attrs;
  11.  struct MinList        com_Childs;
  12. };
  13.  
  14. struct Meta
  15. {
  16.  struct MinNode        meta_Node;
  17.  struct MinList        meta_Attrs;            // attributes
  18.  struct MinList        meta_Groups;
  19.  struct MinList        meta_Flags;            // flags (% char)
  20.  ULONG            *meta_Pool;
  21. };
  22.  
  23. struct Group
  24. {
  25.  struct MinNode        group_Node;
  26.  struct MinList        group_Attrs;            // attributes
  27.  struct MinList        group_Entities;
  28.  char            group_Type[32];            // entity type
  29. };
  30.  
  31. struct Entity
  32. {
  33.  struct MinNode        entity_Node;
  34.  struct MinList        entity_Attrs;            // attributes
  35.  struct MinList        entity_Childs;            // None, now
  36.  int            entity_ID;
  37. };
  38.  
  39. struct Attr                        // is also for FLAG!
  40. {
  41.  struct MinNode        attr_Node;
  42.  char            attr_Name[32];
  43.  char            attr_Value[512];
  44. };
  45.  
  46. #define AllocMetaMem(meta,siz) AllocPooled((struct Meta *)meta->meta_Pool,siz)
  47. #define FreeMetaMem(meta,siz) FreePooled((struct Meta *)meta->meta_Pool,siz)
  48.  
  49. extern struct Meta *NewMeta(struct Common *parent);
  50. extern struct Group *NewGroup(struct Meta *meta,char *type);
  51. extern struct Entity *NewEntity(struct Group *group,struct Meta *meta,int ID);
  52. extern struct Attr *NewAttr(struct Common *com,struct Meta *meta,char *name,char *value);
  53. extern struct Attr *NewFlag(struct Meta *meta,char *name,char *value);
  54. extern char *HaveAttrValue(struct Common *com,char *name);
  55.  
  56. #define META_STARTER '#'
  57. #define META_FINISHER '-'
  58. #define META_ATTR '$'
  59. #define META_FLAG '%'
  60.  
  61. #endif
  62.  
  63.